<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
            <li class="active"><a href="{:url('cate/index')}">商品分类</a></li>
            <li><a href="{:url('cate/add')}">添加商品分类</a></li>
		</ul>
        <form class="well form-inline margin-top-20" method="post" action="{:url('cate/index')}">
            分类名称:
            <input type="text" class="form-control" name="name" value="{:input('request.name/s','')}" placeholder="请输入分类名称">
            状态:
            <select name="status" class="form-control">
                <option value="0">--全部--</option>
                <option <if condition="isset($status) && $status eq '1'"> selected </if> value="1">--上架--</option>
                <option <if condition="isset($status) && $status eq '2'"> selected </if> value="2">--下架--</option>
            </select>
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:url('cate/index')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
                    <th width="50">ID</th>
                    <th>商品分类名称</th>
                    <th>商品分类状态</th>
                    <th>父级分类</th>
                    <th>添加时间</th>
                    <th>{:lang('ACTIONS')}</th>
				</tr>
			</thead>
			<tbody>
                <foreach name="cate" item="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.name}</td>
                        <td>{$vo['status'] == 1 ? '正常' : '下架'}</td>
                        <td>{$vo.fname}</td>
                        <td>{$vo.addtime}</td>
                        <td>
                            <a class="btn btn-xs btn-primary" href="{:url('cate/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
                            <if condition="$vo['status'] eq 1">
                            <a class="btn btn-xs btn-info" href="{:url('cate/update',array('id'=>$vo['id'],'status'=>2))}">下架</a>
                            <else />
                            <a class="btn btn-xs btn-info" href="{:url('cate/update',array('id'=>$vo['id'],'status'=>1))}">上线</a>
                            </if>
                        </td>
                    </tr>
                </foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>